Bring back accidentally removed pool params#5861
Merged
adhami3310 merged 1 commit intomainfrom Oct 8, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
This PR restores four critical SQLAlchemy connection pool parameters that were accidentally removed from the `get_engine_args` function in `reflex/model.py`. The parameters being restored are:pool_size: Controls the number of persistent database connections (default: 5)max_overflow: Sets additional connections beyond the pool size (default: 10)pool_recycle: Defines connection recycling interval in seconds (default: -1 for no recycling)pool_timeout: Specifies timeout for obtaining connections (default: 30.0 seconds)
These parameters are configured through environment variables (SQLALCHEMY_POOL_SIZE, SQLALCHEMY_MAX_OVERFLOW, SQLALCHEMY_POOL_RECYCLE, SQLALCHEMY_POOL_TIMEOUT) and are essential for production database connection management. The restoration ensures that Reflex applications can properly tune their database connection pools to handle concurrent connections, prevent connection exhaustion, and manage database resources efficiently according to their specific deployment requirements.
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| reflex/model.py | 5/5 | Restored four accidentally removed SQLAlchemy connection pool parameters essential for database performance tuning |
Confidence score: 5/5
- This PR is extremely safe to merge with minimal risk as it restores essential functionality without introducing new logic
- Score reflects the straightforward nature of restoring accidentally removed parameters that are critical for production database performance
- No files require special attention as this is a simple restoration of well-established SQLAlchemy configuration parameters
Sequence Diagram
sequenceDiagram
participant User
participant "Reflex App" as App
participant "get_engine_args()" as GetArgs
participant "Environment Variables" as Env
participant "get_engine()" as GetEngine
participant "SQLAlchemy Engine" as Engine
participant "Database" as DB
User->>App: "Start application with database operations"
App->>GetEngine: "get_engine(url)"
GetEngine->>GetArgs: "get_engine_args(url)"
GetArgs->>Env: "SQLALCHEMY_ECHO.get()"
Env-->>GetArgs: "echo value"
GetArgs->>Env: "SQLALCHEMY_POOL_PRE_PING.get()"
Env-->>GetArgs: "pool_pre_ping value"
GetArgs->>Env: "SQLALCHEMY_POOL_SIZE.get()"
Env-->>GetArgs: "pool_size value"
GetArgs->>Env: "SQLALCHEMY_MAX_OVERFLOW.get()"
Env-->>GetArgs: "max_overflow value"
GetArgs->>Env: "SQLALCHEMY_POOL_RECYCLE.get()"
Env-->>GetArgs: "pool_recycle value"
GetArgs->>Env: "SQLALCHEMY_POOL_TIMEOUT.get()"
Env-->>GetArgs: "pool_timeout value"
GetArgs-->>GetEngine: "kwargs dict with pool parameters"
GetEngine->>Engine: "create_engine(url, **kwargs)"
Engine->>DB: "Connect with pool configuration"
DB-->>Engine: "Connection established"
Engine-->>GetEngine: "configured engine"
GetEngine-->>App: "database engine"
App->>Engine: "Execute database operations"
Engine->>DB: "Query with connection pooling"
DB-->>Engine: "Results"
Engine-->>App: "Query results"
1 file reviewed, no comments
CodSpeed Performance ReportMerging #5861 will not alter performanceComparing Summary
|
adhami3310
approved these changes
Oct 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.